package com.whmnx.home.ui.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.ViewGroup;

import androidx.annotation.Nullable;

import com.google.android.material.tabs.TabLayout;
import com.whmnx.home.BR;
import com.whmnx.home.R;
import com.whmnx.home.databinding.FragmentHomeBinding;
import com.whmnx.home.ui.model.HomeModel;

import io.reactivex.annotations.NonNull;
import me.goldze.mvvmhabit.base.BaseFragment;

/**
 * author : huang
 * date   : 2020/9/10 0010 16:42
 * version: 1.0
 * @author Administrator
 */

public class HomeFragment extends BaseFragment<FragmentHomeBinding, HomeModel> {
    @Override
    public int initContentView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        return R.layout.fragment_home;
    }

    @Override
    public int initVariableId() {
        return BR.viewModel;
    }


    @Override
    public void initData() {
        super.initData();
        binding.tabs.setupWithViewPager(binding.viewPager);
        binding.viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(binding.tabs));
        viewModel.addPage();
    }
}
